package com.clps.designPatterns.建造者模式;

/**
 * 建造模式是对象的创建模式。建造模式可以将一个产品的内部属性描述与产品的生产过程分割，从而可以使一个建造过程生成具有不同的内部表象的产品对象。
 * 也就是使用一个中介对象封装一系列的对象交互，使其各个对象不需要显示的相互调用，而且可以单独的改变对象之间的交互。
 */
public class C01_InScene {
    public static void main(String[] args) {

    }
}

class MobileSoft{
    private  String design;
    private  String frame;
    private  String develop;
    private  String online;

    public String getDesign() {
        return design;
    }

    public void setDesign(String design) {
        this.design = design;
    }

    public String getFrame() {
        return frame;
    }

    public void setFrame(String frame) {
        this.frame = frame;
    }

    public String getDevelop() {
        return develop;
    }

    public void setDevelop(String develop) {
        this.develop = develop;
    }

    public String getOnline() {
        return online;
    }

    public void setOnline(String online) {
        this.online = online;
    }

    /**
     * 手机软件抽象类型
     */

    abstract class  BuilderSoft{
        public  abstract  void earlywork();
        public  abstract  void midWork();
        public  abstract  void lateWork();
        public  abstract  MobileSoft builderSoft ();

    }


    class SoftImpl extends  BuilderSoft{

        private  MobileSoft mobileSoft = new MobileSoft();
        @Override
        public void earlywork() {
            System.out.println("软件前期设计...");
        }

        @Override
        public void midWork() {
            System.out.println("软件中期架构...");
            System.out.println("软件中期开发...");
        }

        @Override
        public void lateWork() {
            System.out.println("软件后期上线...");
        }

        @Override
        public MobileSoft builderSoft() {
            return mobileSoft;
        }
    }


    class  ProjectManger{
        private BuilderSoft builderSoft ;
        ProjectManger (BuilderSoft builderSoft){
            this.builderSoft = builderSoft ;
        }

        // 统筹项目周期
        public void createSoft (){
            builderSoft.earlywork();
            builderSoft.midWork();
            builderSoft.lateWork();
            // MobileSoft mobileSoft = builderSoft.builderSoft() ;
            // return mobileSoft ;
        }
    }

}
